package com.edu.controller;

import com.edu.entity.StuInfo;
import com.edu.service.StuInfoService;
import com.edu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: graduate
 * @description:
 * @author: K.faWu
 * @create: 2021-05-24 22:44
 **/

@RestController
@RequestMapping("/stuInfo")
public class StuInfoController {
    @Autowired
    private StuInfoService stuInfoService;

    /**
     * 查询该学生是否完善信息
     */
    @GetMapping("/isok/{stuId}")
    public Result isok(@PathVariable Long stuId){
        if(stuInfoService.isok(stuId)){
            return Result.success();
        }
        return Result.failure();
    }

    /**
     * 完善信息
     */
    @PostMapping()
    public Result upInfo(@RequestBody StuInfo stuInfo){
        stuInfoService.upStuInfo(stuInfo);
        return Result.success();
    }
}
